package com.huike.mapper.course;

import com.github.pagehelper.Page;
import com.huike.dto.CoursePagDTO;
import com.huike.vo.Course;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CourseMapper {
    //分页查询
    Page<Course> selectList(CoursePagDTO dto);
    //批量删除
    void delete(List<Integer> ids);
    @Insert("insert into tb_course (name,subject,price,info,applicable_person,create_time) values (#{name},#{subject},#{price},#{info},#{applicablePerson},#{createTime})")
    void save(Course course);
    @Select("select * from tb_course where id=#{id}")
    Course SelectCourseById(Long id);

    void update(Course course);
    //全部查询
    @Select("select * from tb_course")
    List<Course> SelectCourseList();
}
